package com.chixing.day06_static.static_demo;

public class Student {

    static{
        System.out.println("static 代码块1");
    }
    public static  int a = 10;  // 类变量 : Student.a [共享数据区]
    public static Student stu = new Student();

    public  int b;              // 实例变量 : Student stu1 = new Student();    stu1.b
    public  int c = 20;         // 实例变量 : Student stu2 = new Student();    stu2.b


    static{
        System.out.println("static 代码块2");
    }
    public Student(){
        System.out.println("构造函数中访问 b = " + b);
        System.out.println("构造函数中访问 c = " + c);
        System.out.println("student 的无参构造函数");
    }
    // 构造块、普通代码块 （几乎不用）
    {
        System.out.println("构造块111");
        System.out.println("构造块111中访问 b = " + b);
        System.out.println("构造块111中访问 c = " + c);
    }
}
